#include <QApplication>
#include <QVBoxLayout>
#include "ElButton.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    QWidget w;
    w.setWindowTitle("仿饿了么按钮组件升级版");
    QVBoxLayout *layout = new QVBoxLayout(&w);

    // 常规按钮
    ElButton *btn1 = new ElButton("默认按钮", ElButton::Default);
    ElButton *btn2 = new ElButton("主要按钮", ElButton::Primary, ElButton::Round);
    ElButton *btn3 = new ElButton("成功按钮", ElButton::Success);
    ElButton *btn4 = new ElButton("危险按钮", ElButton::Danger, ElButton::Round);
    ElButton *btn5 = new ElButton("警告按钮", ElButton::Warning);

    // 图标按钮
    ElButton *iconBtn = new ElButton("", ElButton::Primary, ElButton::Circle);
    iconBtn->setBtnIcon(QIcon(":/icon/search.png"), 36);

    layout->addWidget(btn1);
    layout->addWidget(btn2);
    layout->addWidget(btn3);
    layout->addWidget(btn4);
    layout->addWidget(btn5);
    layout->addWidget(iconBtn);

    w.show();
    return a.exec();
}
